#include <utl/test.h>
#include <Windows.h>
#include <utl/vector.h>
#include <stdio.h>

void utl::TestApi::run_test(u32 count)
{
	auto get_tick = 
		[]()
		{
			LARGE_INTEGER counter;
			QueryPerformanceCounter(&counter);
			return counter.QuadPart;
		};

	LONGLONG ave_val{};

	for (u32 i = 0; i < count; i++)
	{
		auto begin = get_tick();
		this->one_test();
		auto end   = get_tick();
		ave_val += (end - begin);
	}

	auto res = static_cast<double>(ave_val) / static_cast<double>(count);

	printf("%s : %.3f\n", this->test_name, res);
}

utl::TestApi::TestApi(const char* name) :
	test_name{ name }
{}